# config.py
import os

class Config:
    # Flask 设置
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'your_secret_key_here'
    FLASK_APP = os.environ.get('FLASK_APP') or 'app.py'
    FLASK_ENV = os.environ.get('FLASK_ENV') or 'development'

    # MySQL 配置
    MYSQL_HOST = os.environ.get('MYSQL_HOST') or 'localhost'
    MYSQL_USER = os.environ.get('MYSQL_USER') or 'root'
    MYSQL_PASSWORD = os.environ.get('MYSQL_PASSWORD') or 'your_password_here'
    MYSQL_DB = os.environ.get('MYSQL_DB') or 'dco_db'

    SQLALCHEMY_DATABASE_URI = f"mysql://{MYSQL_USER}:{MYSQL_PASSWORD}@{MYSQL_HOST}/{MYSQL_DB}"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # Webhook 配置
    WEBHOOK_SECRET = os.environ.get('WEBHOOK_SECRET') or ''

    # SMTP 配置
    MAIL_SERVER = os.environ.get('SMTP_SERVER') or 'smtp.qq.com'
    MAIL_PORT = int(os.environ.get('SMTP_PORT') or 587)
    MAIL_USE_TLS = True
    MAIL_USERNAME = os.environ.get('SMTP_USERNAME') or '2742645790@qq.com'
    MAIL_PASSWORD = os.environ.get('SMTP_PASSWORD') or 'vfostijcuyyndhai'
    MAIL_DEFAULT_SENDER = MAIL_USERNAME

    # 邮件通知设置
    EMAIL_RECIPIENT = os.environ.get('EMAIL_RECIPIENT') or '2742645790@qq.com'
    EMAIL_SUBJECT = os.environ.get('EMAIL_SUBJECT') or 'DCO未签署提醒'
    EMAIL_BODY = os.environ.get('EMAIL_BODY') or '你本次提交的内容未签署DCO！'
